<template>
  <div class="study-status-selector">
    <div 
      v-for="(status, index) in statusOptions" 
      :key="index"
      :class="['status-item', { active: modelValue === status.value }]"
      @click="$emit('update:modelValue', status.value)"
    >
      <div :class="['status-dot', status.value]"></div>
      <span>{{ status.label }}</span>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  modelValue: {
    type: String,
    default: 'incomplete'
  }
})

defineEmits(['update:modelValue'])

const statusOptions = [
  { label: '未完成', value: 'incomplete' },
  { label: '已完成', value: 'complete' },
  { label: '暂无', value: 'none' }
]
</script>

<style lang="scss" scoped>
.study-status-selector {
  display: flex;
  gap: 16px;
  align-items: center;

  .status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    // border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size:12px;
    font-weight:400;
    &:hover {
      background-color: rgba(0, 0, 0, 0.05);
    }

    .status-dot {
      width: 8px;
      height: 8px;
      
    //   border-radius: 50%;

      &.incomplete {
        background-color: #1890ff;
      }

      &.complete {
        background-color: #52c41a;
      }

      &.none {
        background-color: #d9d9d9;
      }
    }
  }
}
</style>
